import organizationManagementApi from '@/config/server/api/user.js'

function getOA(info) {
  return organizationManagementApi.organization.fetch(info).then(res => {
    return res
  })
}

function getOrg(info) {
  return organizationManagementApi.organizationManagement.getOrg.fetch(info).then(res => {
    return res
  })
}

function delNode(info) {
  return organizationManagementApi.organizationManagement.delNode.fetch(info).then(res => {
    return res
  })
}

function bindOrg(info) {
  return organizationManagementApi.organizationManagement.bindOrg.fetch(info).then(res => {
    return res
  })
}

function addNode(info) {
  return organizationManagementApi.organizationManagement.addNode.fetch(info).then(res => {
    return res
  })
}

function editNode(info) {
  return organizationManagementApi.organizationManagement.editNode.fetch(info).then(res => {
    return res
  })
}

function getOrgBindInfo(info) {
  return organizationManagementApi.organizationManagement.getOrgBindInfo.fetch(info).then(
    res => {
      return res
    })
}

function teamCompanyScopeSaveOrUpdate(info) {
  return organizationManagementApi.organizationManagement.teamCompanyScopeSaveOrUpdate.fetch(
    info).then(res => {
    return res
  })
}

function getScopeCompanyByCompanyId(info) {
  return organizationManagementApi.organizationManagement.getScopeCompanyByCompanyId.fetch(
    info).then(res => {
    return res
  })
}

function getNotOrgCount(orgId) {
  return organizationManagementApi.getNotOrgCount.fetch({ orgId })
}

function getNoJyOfficeNum(jyId) {
  return organizationManagementApi.getNoJyOfficeNum.fetch({ jyId })
}

export default {
  getOA,
  getOrg,
  delNode,
  bindOrg,
  addNode,
  editNode,
  getOrgBindInfo,
  teamCompanyScopeSaveOrUpdate,
  getScopeCompanyByCompanyId,
  getNotOrgCount,
  getNoJyOfficeNum
}
